Skip to content

Conversation

@bobtista
Copy link

@bobtista bobtista commented Oct 23, 2025

  • Moved 69 identical network files from Generals/GeneralsMD to Core

@xezon
Copy link

xezon commented Oct 23, 2025

Please make the unify a separate Pull Request.

@bobtista bobtista force-pushed the bobtista/unify-network branch from 771b9a9 to d3c288d Compare October 23, 2025 14:44
@bobtista bobtista changed the title refactor(network): Unify identical network code and replace manual size calculations with packed structs refactor(network): Unify identical network code Oct 23, 2025
@bobtista
Copy link
Author

Please make the unify a separate Pull Request.

Done. Follow up PR with refactor is #1734

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am working on a change to try merge file contents in GameNetwork, which then means we can move more files here.

@bobtista bobtista force-pushed the bobtista/unify-network branch from d3c288d to bb35461 Compare October 23, 2025 19:59
@xezon xezon changed the title refactor(network): Unify identical network code unify(network): Move GameNetwork and GameSpy files to Core Oct 23, 2025
@xezon xezon added Gen Relates to Generals ZH Relates to Zero Hour Unify Unifies code between Generals and Zero Hour labels Oct 23, 2025
@xezon xezon added this to the Code foundation build up milestone Oct 23, 2025
@xezon
Copy link

xezon commented Oct 23, 2025

I am working on a change to try merge file contents in GameNetwork, which then means we can move more files here.

Done. After #1735 is merged, we can move all GameNetwork + GameSpy files except GUIUtil.cpp

@bobtista bobtista force-pushed the bobtista/unify-network branch 4 times, most recently from f416fe8 to 6ac9e87 Compare October 26, 2025 03:45
@bobtista bobtista force-pushed the bobtista/unify-network branch 3 times, most recently from fa77f30 to e1e625a Compare November 6, 2025 21:14
@xezon
Copy link

xezon commented Nov 9, 2025

We can now do this move.

@bobtista bobtista force-pushed the bobtista/unify-network branch from e1e625a to ebec515 Compare November 9, 2025 17:24
Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time, prefer using the python script to move files. It gives more confidence that things are correct and is easier to repeat.

@bobtista bobtista force-pushed the bobtista/unify-network branch from 9463a2f to 2b661e2 Compare November 9, 2025 19:17
Include/GameNetwork/GameSpy/ThreadUtils.h
# Include/GameNetwork/GameSpyChat.h
# Include/GameNetwork/GameSpyGameInfo.h
# Include/GameNetwork/GameSpyGP.h
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these unused like their CPP counterparts? If yes, can mark them so.

Source/GameNetwork/GameMessageParser.cpp
# Source/GameNetwork/GameSpyChat.cpp # unused
# Source/GameNetwork/GameSpyGameInfo.cpp # unused
# Source/GameNetwork/GameSpyGP.cpp # unused
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 lines were touched when not so necessary.

@@ -1,5 +1,5 @@
/*
** Command & Conquer Generals(tm)
** Command & Conquer Generals Zero Hour(tm)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 header files were edited in Generals.

@@ -127,44 +127,112 @@ def unify_move_file(fromGame: Game, fromFile: str, toGame: Game, toFile: str):


def main():

#unify_file(Game.ZEROHOUR, "GameEngine/Include/Common/crc.h", Game.CORE, "GameEngine/Include/Common/crc.h")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not remove the old ones.

#unify_move_file(Game.GENERALS, "GameEngine/Source/Common/System/GameMemoryInitPools_Generals.inl", Game.CORE, "GameEngine/Source/Common/System/GameMemoryInitPools_Generals.inl")
#unify_move_file(Game.ZEROHOUR, "GameEngine/Source/Common/System/GameMemoryInitPools_GeneralsMD.inl", Game.CORE, "GameEngine/Source/Common/System/GameMemoryInitPools_GeneralsMD.inl")
# GameNetwork Headers
unify_file(Game.ZEROHOUR, "GameEngine/Include/GameNetwork/Connection.h", Game.CORE, "GameEngine/Include/GameNetwork/Connection.h")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add them in commented state here like the others. Is not really great but I did not have better idea when making this script. Maybe we should have new scripts for individual moves, calling into this script. Then it would not need this commenting approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Gen Relates to Generals Unify Unifies code between Generals and Zero Hour ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants